﻿using Ninject;
using Ninject.Parameters;

namespace Calculator
{
    public class CalculatorClass
    {
        public int Calculate(string expression)
        {
            var ninjectContainer = new NinjectContainer();

            var mathExpression = ninjectContainer.NinjectKernel.Get<InfixExpression>(new ConstructorArgument("expressionParam", expression));

            return mathExpression.ReturnPostfixExpression().ComputeFromPostfix();
        }
    }
}